<%@include file="/pages/include/tag_include.jsp"%>
<%@include file="/pages/include/base_context.jsp"%>
<div class="container">
     <%@include file="/pages/include/message_display_include.jsp"%>

    <form class="form-horizontal" method="POST" action='<s:url value="/user/save.do"/>?form.existingId=<s:property value="%{form.userInfo.id}"/>'>
        <div class="control-group">
            <label class="control-label" for="inputUsername"><s:text name="username" /></label>
            <div class="controls">
                <input autocomplete="false" type="text" name="form.userInfo.userAccount.username" value='<s:property value="%{form.userInfo.userAccount.username}"/>' id="inputUsername" placeholder="Username">
            </div>
        </div>
        <div class="control-group">
            <label class="control-label" for="inputPassword"><s:text name="password" /></label>
            <div class="controls">
                <input autocomplete="false" type="password" name="form.userInfo.userAccount.password" value='<s:property value="%{form.userInfo.userAccount.password}"/>' id="inputPassword" placeholder="Password" />
            </div>
        </div>

        <div class="control-group">
            <label class="control-label" for="inputFullName"><s:text name="full_name" /></label>
            <div class="controls">
                <input type="text" name="form.userInfo.fullName" value='<s:property value="%{form.userInfo.fullName}"/>'  id="inputFullName" placeholder="Full Name" />
            </div>
        </div>
        <div class="control-group">
            <label class="control-label" for="inputEmail"><s:text name="email" /></label>
            <div class="controls">
                <input type="text" name="form.userInfo.email" value='<s:property value="%{form.userInfo.email}"/>' id="inputEmail" placeholder="Email" />
            </div>
        </div>
        <div class="control-group">
            <label class="control-label" for="inputGender"><s:text name="gender" /></label>
            <s:set name="gender" value="%{form.userInfo.gender}"/>
            <div class="controls">
                <select name="form.userInfo.gender">
                    <option value="M" <s:if test='%{#gender==("M")}'>selected="selected"</s:if> >Male</option>
                    <option value="F" <s:if test='%{#gender==("F")}'>selected="selected"</s:if> >Female</option>
                </select>

            </div>
        </div>

        <% /*<div class="control-group">
            <label class="control-label" for="inputDob"><s:text name="dob" /></label>
            <div class="controls">
                <input type="text" name="form.userInfo.dob" value='<s:property value="%{form.userInfo.dob}"/>' id="inputDob" placeholder="Date of Birth" />
            </div>
        </div>*/ %>

        <div class="control-group">
            <label class="control-label" for="inputOfficePhone"><s:text name="office_phone" /></label>
            <div class="controls">
                <input type="text" name="form.userInfo.officePhone" value='<s:property value="%{form.userInfo.officePhone}"/>' id="inputOfficePhone" placeholder="Office Phone" />
            </div>
        </div>
        <div class="control-group">
            <label class="control-label" for="inputMobilePhone"><s:text name="mobile_phone" /></label>
            <div class="controls">
                <input type="text" name="form.userInfo.mobilePhone" value='<s:property value="%{form.userInfo.mobilePhone}"/>' id="inputMobilePhone" placeholder="Mobile Phone" />
            </div>
        </div>


        <div class="control-group">
            <label class="control-label" for="inputRoleType"><s:text name="role_type" /></label>
            <div class="controls">
                <s:iterator var="roletype" value="%{form.roleTypes}">
                    <label><input type="checkbox" name="userRoleId" value="<s:property value="id"/>" <s:if test="%{form.currentRoleTypes.contains(id)}">checked="checked"</s:if> /> <s:property value="code"/></label>
                </s:iterator>
            </div>
        </div>
            <a href="<s:url value="/user/list.do"/>" class="btn btn-danger" ><s:text name="cancel"/></a>
            <input type="submit" value="<s:text name="save"/>" class="btn btn-success" />
    </form>

</div>
